#pragma once

#include <memory>
#include <vector>
#include "classfile/member_info.h"
#include "instructions/base/bytecode_reader.h"
#include "rtda/thread.h"
#include "rtda/frame.h"
// #include "rtda/heap/class_loader.h"
#include "rtda/heap/method.h"

namespace jvm {

class Interpreter {
public:
    static void interpret(std::shared_ptr<heap::Method> methodInfo);
    
private:
    static void loop(std::shared_ptr<rtda::Thread> thread, const std::vector<uint8_t>& bytecode);
    static void catchErr(std::shared_ptr<rtda::Frame> frame);
};

} // namespace jvm